package com.cayden.componets.canal;

import com.alibaba.otter.canal.client.CanalConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author cayden
 * @date 2021-10-19 13:07
 */
public class BaseCanalClient {

    protected final static Logger logger = LoggerFactory.getLogger(BaseCanalClient.class);

    /**
     * 对于持久化canal 是否再运行的标志
     */
    protected volatile boolean running = false;

    protected Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler(){
        @Override
        public void uncaughtException(Thread t, Throwable e) {
            logger.error("parse events has an error", e);
        }
    };

    protected Thread thread = null;

    /**
     * canal 连接
     */
    protected CanalConnector connector;

    protected String destination;

    public void setConnector(CanalConnector connector) {
        this.connector = connector;
    }



}
